#include <iostream>
#include <stack>
using namespace std;

//https://leetcode.cn/problems/min-stack/description/

class MinStack
{
public:

    void push(int val)
    {
        _st.push(val);
        if (_min_st.empty() || val <= _min_st.top())
            _min_st.push(val);
    }

    void pop()
    {
        if (_st.top() == _min_st.top())
        {
            _min_st.pop();
        }
        _st.pop();
    }

    int top()
    {
        return _st.top();
    }

    int getMin()
    {
        return _min_st.top();
    }
private:
    stack<int> _st;
    stack<int> _min_st;
};

/**
 * Your MinStack object will be instantiated and called as such:
 * MinStack* obj = new MinStack();
 * obj->push(val);
 * obj->pop();
 * int param_3 = obj->top();
 * int param_4 = obj->getMin();
 */




int main()
{
    return 0;
}